<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <title>Document</title>


</head>

<body>

<div id="tuozhuai_view" draggable="true" style="width: 100px;height: 100px;background-color: blue" ondrop="drop(event)" ondragover="allowDrop(event)">


</div>


<script type="text/javascript">
    function allowDrop(ev)
    {
        ev.preventDefault();
    }

    function drag(ev)
    {
        ev.dataTransfer.setData("Text",ev.target.id);
    }

    function drop(ev)
    {
        ev.preventDefault();
        var data=ev.dataTransfer.getData("Text");
        ev.target.appendChild(document.getElementById(data));
    }
</script>

</body>

</html>